package model

const (
	MEDIA_TYPE_TEXT = 1 // 文本样式
	MEDIA_TYPE_NEWS = 2 // 图文样式
	MEDIA_TYPE_VOICE = 3 // 语音样式 amount单位秒
	MEDIA_TYPE_IMG = 4 // 图片样式
	MEDIA_TYPE_RED_PACKAGR = 5 //红包样式 红包amount 单位分
	MEDIA_TYPE_EMOJ = 6 // emoj表情
	MEDIA_TYPE_LINK = 7 // 链接
	MEDIA_TYPE_VIDEO = 8 // 视频
	MEDIA_TYPE_CONTACT = 9 // 名片
)

const (
	//点对点单聊 dstid 用户id
	CMD_SINGLE_MSG = 10
	//群聊 dstid 群id
	CMD_ROOM_MSG = 11
	//心跳消息，不处理
	CMD_HEART = 0
	//下线
	CMD_OFFLINE = 12
	//连接成功
	CMD_SUCCESS = 1
	// 连接失败
	CMD_Fail = 2
)

//消息体
type Message struct {
	GN_MODEL
	Cmd     	uint8	`form:"cmd" json:"cmd,omitempty" gorm:"type:tinyint(3);unsigned;comment:群聊还是私聊"`
	UserId  	uint64	`form:"user_id" json:"user_id" gorm:"type:bigint(20);unsigned;comment:所属谁的id"`
	DstId   	uint64	`form:"dst_id" json:"dst_id" gorm:"type:bigint(20);unsigned;comment:对端用户ID/群ID"`
	//UserUuid	uuid.UUID `form:"user_uuid" json:"user_uuid" gorm:"comment:所属谁的id，UUID"`
	//DstUuid		uuid.UUID `form:"dst_uuid" json:"dst_uuid" gorm:"comment:对端用户ID，UUID"`
	Read 		uint8	`form:"read" json:"read,omitempty" gorm:"type:tinyint(3);unsigned;default:0;comment:是否已读 0-未读 1-已读"`
	Del     	uint8	`form:"del" json:"del,omitempty" gorm:"type:tinyint(3);unsigned;default:0;comment:是否删除 0-未删除 1-已删除"`
	Media   	uint8	`form:"media" json:"media,omitempty"gorm:"type:tinyint(3);unsigned;default:1;comment:消息按照什么样式展示"`
	Content 	string	`form:"content" json:"content,omitempty" gorm:"type:varchar(255);not null;comment:消息的内容"`
	ThumbPic 	string	`form:"thumb_pic" json:"thumb_pic,omitempty" gorm:"type:varchar(255);comment:缩略图"`
	Pic     	string	`form:"pic" json:"pic,omitempty" gorm:"type:varchar(255);comment:预览图片"`
	Url     	string	`form:"url" json:"url,omitempty" gorm:"type:varchar(255);comment:服务的URL"`
	Memo    	string	`form:"memo" json:"memo,omitempty" gorm:"type:varchar(255);comment:简单描述"`
	Amount  	int	`form:"amount" json:"amount,omitempty" gorm:"type:int(10);default:0;comment:其他和数字相关的"`
}